FROM		    phusion/baseimage:bionic-1.0.0
LABEL           maintainer="lawrencezhu2018@outlook.com"

ENV             JDK_DIR=/opt/common/jdk
ENV             JDK_TAG=11.0.10.5
ENV             JDK_VERSION=Alibaba_Dragonwell_${JDK_TAG}
ENV             ARCH=x64

ENV             ARTHAS_DIR=/opt/common/arthas
ENV             ARTHAS_TAG=3.5.0

ENV             PATH=${JDK_DIR}/${JDK_VERSION}/bin:$PATH

WORKDIR         ${JDK_DIR}

RUN             export DEBIAN_FRONTEND=noninteractive && \
                cd ${JDK_DIR} && \
                curl -L -O https://dragonwell.oss-cn-shanghai.aliyuncs.com/11/${JDK_TAG}_GA/${ARCH}/${JDK_VERSION}_linux_${ARCH}.tar.gz  && \
                tar -zxvf ${JDK_VERSION}_linux_${ARCH}.tar.gz && \
                mv jdk* ${JDK_VERSION} && \
                echo "export JAVA_HOME=${JDK_DIR}/${JDK_VERSION}\nexport PATH=\${JAVA_HOME}/bin:\$PATH" >> /etc/bash.bashrc && \
                rm -f ${JDK_VERSION}_linux_${ARCH}.tar.gz && \
                apt-get update && \
                apt-get install -y unzip && \
                mkdir -p ${ARTHAS_DIR} && \
                cd ${ARTHAS_DIR} && \
                curl -L -O https://maven.aliyun.com/repository/public/com/taobao/arthas/arthas-packaging/${ARTHAS_TAG}/arthas-packaging-${ARTHAS_TAG}-bin.zip && \
                unzip arthas-packaging-${ARTHAS_TAG}-bin.zip -d arthas-packaging-${ARTHAS_TAG}-bin && \
                rm -f arthas-packaging-${ARTHAS_TAG}-bin.zip && \
                apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

CMD             ["/sbin/my_init"]